<?php
	session_start();
	ob_start();
	function __autoload($TenLop)
	{
		include_once "classes/" . $TenLop . ".php";
	}
	include_once "thuvien.php";
?>
<!DOCTYPE html>
<html>
	<head>
		<title> Quản lý điểm trường THCS </title>
		<meta charset="UTF-8" />
	
		<link rel="stylesheet" href="css/reset.css" /> <!-- CSS reset -->
		<link rel="stylesheet" href="css/style.css" /> <!-- Resource style -->
	<script src="js/modernizr.js"></script> <!-- Modernizr -->
    <!--- Login ---->
    <style type="text/css">
		.container {width: 960px; margin: 0 auto; overflow: hidden;}
		
		#content {	float: left; width: 100%;}
		
		.post { margin: 0 auto; padding-bottom: 50px; float: left; width: 960px; }
		
		.btn-sign {
			width:460px;
			margin-bottom:20px;
			margin:0 auto;
			padding:20px;
			border-radius:5px;
			background: -moz-linear-gradient(center top, #00c6ff, #018eb6);
			background: -webkit-gradient(linear, left top, left bottom, from(#00c6ff), to(#018eb6));
			background:  -o-linear-gradient(top, #00c6ff, #018eb6);
			filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#00c6ff', EndColorStr='#018eb6');
			text-align:center;
			font-size:36px;
			color:#fff;
			text-transform:uppercase;
		}
		
		.btn-sign a { color:#fff; text-shadow:0 1px 2px #161616; }
		
		#mask {
			display: none;
			background: #000; 
			position: fixed; left: 0; top: 0; 
			z-index: 10;
			width: 100%; height: 100%;
			opacity: 0.8;
			z-index: 999;
		}
		
		.login-popup{
			display:none;
			background: #333;
			padding: 10px; 	
			border: 2px solid #ddd;
			float: left;
			font-size: 1.2em;
			position: fixed;
			top: 50%; left: 50%;
			z-index: 99999;
			box-shadow: 0px 0px 20px #999;
			-moz-box-shadow: 0px 0px 20px #999; /* Firefox */
			-webkit-box-shadow: 0px 0px 20px #999; /* Safari, Chrome */
			border-radius:3px 3px 3px 3px;
			-moz-border-radius: 3px; /* Firefox */
			-webkit-border-radius: 3px; /* Safari, Chrome */
		}
		
		img.btn_close {
			float: right; 
			margin: -28px -28px 0 0;
		}
		
		fieldset { 
			border:none; 
		}
		
		form.signin .textbox label { 
			display:block; 
			padding-bottom:7px; 
		}
		
		form.signin .textbox span { 
			display:block;
		}
		
		form.signin p, form.signin span { 
			color:#999; 
			font-size:11px; 
			line-height:18px;
		} 
		
		form.signin .textbox input { 
			background:#666666; 
			border-bottom:1px solid #333;
			border-left:1px solid #000;
			border-right:1px solid #333;
			border-top:1px solid #000;
			color:#fff; 
			border-radius: 3px 3px 3px 3px;
			-moz-border-radius: 3px;
			-webkit-border-radius: 3px;
			font:13px Arial, Helvetica, sans-serif;
			padding:6px 6px 4px;
			width:200px;
		}
		
		form.signin input:-moz-placeholder { color:#bbb; text-shadow:0 0 2px #000; }
		form.signin input::-webkit-input-placeholder { color:#bbb; text-shadow:0 0 2px #000;  }
		
		.button { 
			background: -moz-linear-gradient(center top, #f3f3f3, #dddddd);
			background: -webkit-gradient(linear, left top, left bottom, from(#f3f3f3), to(#dddddd));
			background:  -o-linear-gradient(top, #f3f3f3, #dddddd);
			filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#f3f3f3', EndColorStr='#dddddd');
			border-color:#000; 
			border-width:1px;
			border-radius:4px 4px 4px 4px;
			-moz-border-radius: 4px;
			-webkit-border-radius: 4px;
			color:#333;
			cursor:pointer;
			display:inline-block;
			padding:6px 6px 4px;
			margin-top:10px;
			font:12px; 
			width:214px;
		}
		
		.button:hover { background:#ddd; }
	
	</style>
	<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
    <script type="text/javascript">
        $(document).ready(function() {
                $('a.login-window').click(function() {
                        
                        // Getting the variable's value from a link 
                        var loginBox = $(this).attr('href');
        
                        //Fade in the Popup and add close button
                        $(loginBox).fadeIn(300);
                        
                        //Set the center alignment padding + border
                        var popMargTop = ($(loginBox).height() + 24) / 2; 
                        var popMargLeft = ($(loginBox).width() + 24) / 2; 
                        
                        $(loginBox).css({ 
                                'margin-top' : -popMargTop,
                                'margin-left' : -popMargLeft
                        });
                        
                        // Add the mask to body
                        $('body').append('<div id="mask"></div>');
                        $('#mask').fadeIn(300);
                        
                        return false;
                });
                
                // When clicking on the button close or the mask layer the popup closed
                $('a.close, #mask').live('click', function() { 
                  $('#mask , .login-popup').fadeOut(300 , function() {
                        $('#mask').remove();  
                }); 
                return false;
                });
        });
        </script>
<link rel="canonical" href="http://www.alessioatzeni.com/wp-content/tutorials/jquery/login-box-modal-dialog-window/index.html" />
	</head>
	<body>
		<header class="cd-main-header">
		<ul class="cd-header-buttons">
			<li><a class="cd-search-trigger" href="#cd-search">Search<span></span></a></li>
			<li><a class="cd-nav-trigger" href="#cd-primary-nav">Menu<span></span></a></li>
		</ul> <!-- cd-header-buttons -->
		</header>
		
		<main class="cd-main-content">
			<!-- your content here -->
				<div id="content">
					<div id="show">
						<?php
								$do = isset($_GET['do']) ? $_GET['do'] : "gioithieu";
								include $do . ".php";
						?>
					 </div>
					 
					<div id="divAdLeft" style="DISPLAY: none; POSITION: absolute; TOP: 0px">  
						<img src="images/picture2.gif"/>   
					</div>
						 
					<div id="divAdRight" style="DISPLAY: none; POSITION: absolute; TOP: 0px">     
						<img src="images/picture1_03.gif" />   
					</div>
					 
				</div>
			<div class="cd-overlay"></div>
		</main>
	<div class="clr"></div>
        <div id="footer">
            <p>
                Bản quyền &copy;Nhóm 7-Lớp DH12TH 12-09-2014
            </p>
        </div>
		<nav class="cd-nav">
			<ul id="cd-primary-nav" class="cd-primary-nav is-fixed">
				<li class="has-children">
					<a href="http://codyhouse.co/?p=409">Hệ thống</a>

					<ul class="cd-secondary-nav is-hidden">
					  <li class="go-back"><a href="#0">Menu</a></li>
						<li class="see-all"><a href="trangchu">Đóng lại</a></li>
						<li class="has-children">
							<a href="#">Tài khoản</a>
							<ul class="is-hidden">
								<li class="go-back"><a href="#0">Hệ thống</a></li>
							    <li class="see-all"><a href="#">Tất cả</a></li>
                                <?php
									if(!isset($_SESSION['MaNguoiDung']))
										echo '<li><a href="#login-box" class="login-window">Đăng nhập</a></li>';
									else
									{
										echo '<li><a href="doimatkhau">Đổi mật khẩu</a></li>
										<li><a href="dangxuat">Đăng xuất</a></li>
										<li><a href="hosocanhan">Hồ sơ cá nhân</a></li>
										<li><a href="nguoidung">Người dùng</a></li>';
									}
                                ?>                                                             
                                <li><a href="dangky">Đăng ký</a></li>															
						  </ul>
					  </li>
                      <?php
                      if(isset($_SESSION['MaNguoiDung'])&& $_SESSION['QuyenHan'] != 3)
                      {
						echo '<li class="has-children">
							<a href="http://codyhouse.co/?p=409">Danh mục</a>

							<ul class="is-hidden">
								<li class="go-back"><a href="#0">Hệ thống</a></li>
								<li class="see-all"><a href="#0">Đóng</a></li>
								<li class="has-children">
									<a href="#0">Khối lớp</a>

									<ul class="is-hidden">
										<li class="go-back"><a href="#0">Danh mục</a></li>
										<li class="see-all"><a href="lop">Tất cả</a></li>';
                                        
                                        	$lop = new lopbs();
											$ds = $lop->GetList_Khoi();
											for($i = 0; $i < count($ds); $i++)
											{
												echo '<li><a href="khoi-lop-'.$ds[$i]['MaLop'].'">'.$ds[$i]['TenKhoi'].'</a></li>';
											}
										
										
										
                                       echo '<li><a href="khoi">Danh sách khối</a></li>
									</ul>
								</li>
								<li><a href="monhoc">Môn học</a></li>
								<li><a href="giaovien">Giáo viên</a></li>
								<li><a href="hocsinh">Học sinh</a></li>
								<li><a href="namhoc">Năm học</a></li>
                                <li><a href="hocsinh-thannhan">Thân nhân</a></li>
                                <li><a href="hanhkiem">Hạnh kiểm</a></li>
							</ul>
						</li>';
					}
                    ?>

						<li class="has-children">
							<a href="#0">Tìm kiếm</a>

							<ul class="is-hidden">
								<li class="go-back"><a href="#0">Hệ thống</a></li>
								<li class="see-all"><a href="#0">Tất cả</a></li>
								<li><a href="monhoc-timkiem">Môn học</a></li>
								<li><a href="giaovien-timkiem">Giáo viên</a></li>
								<li><a href="hocsinh-timkiem">Học sinh</a></li>
								<li><a href="lop-timkiem">Lớp</a></li>
							</ul>
						</li>

						
						
						
					</ul>
				</li>
				
				<li class="has-children">
				<a href="#">Trang chủ</a>
				<ul class="cd-nav-icons is-hidden">
				  <li class="go-back"><a href="#0">Menu</a></li>
					<li class="see-all"><a href="trangchu">Trang chủ</a></li>
					<li>
						<a class="cd-nav-item item-1" href="http://codyhouse.co/?p=409">
							<h3>Tin tức</h3>
							<p>This is the item description</p>
						</a>
					</li>


					<li>
						<a class="cd-nav-item item-3" href="http://codyhouse.co/?p=409">
						<h3>Video</h3>
							<p>This is the item description</p>
						</a>
					</li>

					<li>
						<a class="cd-nav-item item-4" href="http://codyhouse.co/?p=409">
							<h3>Hình ảnh</h3>
							<p>This is the item description</p>
						</a>
					</li>

					
				</ul>
			</li>
			</ul> <!-- primary-nav -->
			
		</nav> <!-- cd-nav -->
		<div id="cd-search" class="cd-search">
			<form>
				<input type="search" placeholder="Tìm kiếm...">
			</form>
        </div>
        <script src="js/jquery-2.1.1.js"></script>
        <script src="js/jquery.mobile.custom.min.js"></script>
        <script src="js/main.js"></script> <!-- Resource jQuery -->
       
    
   		 <script>     
			function FloatTopDiv()     
			{     
				startLX = ((document.body.clientWidth -MainContentW)/2)-LeftBannerW-LeftAdjust , startLY = TopAdjust+80;     
				startRX = ((document.body.clientWidth -MainContentW)/2)+MainContentW+RightAdjust , startRY = TopAdjust+80;     
				var d = document;     
				function ml(id)     
				{     
					var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];    
					el.sP=function(x,y){this.style.left=x + 'px';this.style.top=y + 'px';};     
					el.x = startRX;     
					el.y = startRY;     
					return el;     
				}     
				function m2(id)     
				{     
					var e2=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];     
					e2.sP=function(x,y){this.style.left=x + 'px';this.style.top=y + 'px';};     
					e2.x = startLX;     
					e2.y = startLY;     
					return e2;     
				}     
				window.stayTopLeft=function()     
				{     
					if (document.documentElement && document.documentElement.scrollTop)     
						var pY =  document.documentElement.scrollTop;     
					else if (document.body)     
						var pY =  document.body.scrollTop;     
					 if (document.body.scrollTop > 30){startLY = 3;startRY = 3;} else  {startLY = TopAdjust;startRY = TopAdjust;};     
					ftlObj.y += (pY+startRY-ftlObj.y)/16;     
					ftlObj.sP(ftlObj.x, ftlObj.y);     
					ftlObj2.y += (pY+startLY-ftlObj2.y)/16;     
					ftlObj2.sP(ftlObj2.x, ftlObj2.y);     
					setTimeout("stayTopLeft()", 1);     
				}     
				ftlObj = ml("divAdRight");     
				//stayTopLeft();     
				ftlObj2 = m2("divAdLeft");     
				stayTopLeft();     
			}     
			function ShowAdDiv()     
			{     
				var objAdDivRight = document.getElementById("divAdRight");     
				var objAdDivLeft = document.getElementById("divAdLeft");       
				if (document.body.clientWidth < 1000)     
				{     
					objAdDivRight.style.display = "none";     
					objAdDivLeft.style.display = "none";     
				}     
				else     
				{     
					objAdDivRight.style.display = "block";     
					objAdDivLeft.style.display = "block";     
					FloatTopDiv();     
				}     
			} 
		</script>     
		<script>     
			document.write("<script type='text/javascript' language='javascript'>MainContentW = 1000;LeftBannerW = 125;RightBannerW = 125;LeftAdjust = 5;RightAdjust = 5;TopAdjust = 180;ShowAdDiv();window.onresize=ShowAdDiv;;<\/script>");     
		</script>
      	
    <!---Dang nhap--->
    
    <div id="login-box" class="login-popup">
      <form method="post" class="signin" action="index.php?do=dangnhap_xuly">
            <fieldset class="textbox">
            <label class="username">
            <span>Tên đăng nhập:</span>
            <input id="username" name="TenDangNhap" value="" type="text" autocomplete="on" placeholder="Tên đăng nhập:">
            </label>
            
            <label class="password">
            <span>Mật khẩu:</span>
            <input id="password" name="MatKhau" value="" type="password" placeholder="Mật khẩu:">
            </label>
            <input class="submit button" type="submit" value="Đăng nhập" />
            <p>
            <a class="forgot" href="dangky">Đăng ký</a> |  <a class="forgot" href="trangchu">Thoát</a>
            </p>
            
        </fieldset>
      </form>
    </div>
	</body>
</html>